package com.ljy.db_bean_builder.main;

import java.io.IOException;
import java.util.List;


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ljy.db_bean_builder.bean_builder.BeanBuilderUtil;
import com.ljy.db_bean_builder.domain.TableColumn;
import com.ljy.db_bean_builder.mapper.BeanBuilderMapper;

/** 
* @author James
* @date 2018年6月19日 
*/
public class TestMain {
	public static void main(String[] args) throws IOException {
		ApplicationContext context = new ClassPathXmlApplicationContext("/spring/service.xml");
		BeanBuilderMapper mapper=(BeanBuilderMapper)context.getBean("beanBuilderMapper");
		List<TableColumn> tcList=null;
		tcList=mapper.getTableColumnListByTableSchemaAndTableName("findmacau_pro_20180928", "t_word_hot");
		BeanBuilderUtil.createBeanFile(tcList, "WordHot", "mo.com.sinokru.findmacau.background_image.domain", "F:\\java_workspace\\my-study-project\\db-bean-builder\\src\\main\\java\\com\\ljy\\db_bean_builder\\main\\");
		tcList=mapper.getTableColumnListByTableSchemaAndTableName("findmacau_pro_20180928", "t_word_history");
		BeanBuilderUtil.createBeanFile(tcList, "WordHistory", "mo.com.sinokru.findmacau.background_image.domain", "F:\\java_workspace\\my-study-project\\db-bean-builder\\src\\main\\java\\com\\ljy\\db_bean_builder\\main\\");
		System.out.println(tcList);
	}
}
